package com.note.simpleshop.module.order.vo;

import com.note.simpleshop.entity.TbOrder;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/***
 *@ClaseName:订单类
 *
 *@Decription:
 *
 *@Author: xubingbing
 *
 *@Date:2019/1/18 0018 22:38
 */
public class OrderVo {
    private String id;
    private String receiver;
    private String address;
    private String phone;
    private String logisticsNo;
    private BigDecimal orderAmount;
    private String orderNo;
    private Integer orderStatus;
    private Date orderTime;
    private Date payTime;
    private String payType;
    private String prepareId;
    private String userId;
    private String logisticsCode;
    private List<OrderItemVo> orderItemVoList;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getLogisticsNo() {
        return logisticsNo;
    }

    public void setLogisticsNo(String logisticsNo) {
        this.logisticsNo = logisticsNo;
    }

    public BigDecimal getOrderAmount() {
        return orderAmount;
    }

    public void setOrderAmount(BigDecimal orderAmount) {
        this.orderAmount = orderAmount;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public Integer getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
    }

    public Date getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(Date orderTime) {
        this.orderTime = orderTime;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public String getPayType() {
        return payType;
    }

    public void setPayType(String payType) {
        this.payType = payType;
    }

    public String getPrepareId() {
        return prepareId;
    }

    public void setPrepareId(String prepareId) {
        this.prepareId = prepareId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getLogisticsCode() {
        return logisticsCode;
    }

    public void setLogisticsCode(String logisticsCode) {
        this.logisticsCode = logisticsCode;
    }

    public Date getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Date expireTime) {
        this.expireTime = expireTime;
    }

    private Date expireTime;

    public void copy(List<OrderItemVo> orderItemVoList)
    {
        this.orderItemVoList=orderItemVoList;
    }
    public static OrderVo newInstance(TbOrder order) {
        OrderVo orderVo=new OrderVo();
        orderVo.id=order.getId();
        orderVo.receiver=order.getReceiver();
        orderVo.address=order.getAddress();
        orderVo.phone=order.getPhone();
        orderVo.logisticsNo=order.getLogisticsNo();
        orderVo.orderAmount=order.getOrderAmount();
        orderVo.orderNo=order.getOrderNo();
        orderVo.orderStatus=order.getOrderStatus();
        orderVo.orderTime=order.getOrderTime();
        orderVo.payTime=order.getPayTime();
        orderVo.payType=order.getPayType();
        orderVo.prepareId=order.getPrepareId();
        orderVo.userId=order.getUserId();
        orderVo.logisticsCode=order.getLogisticsCode();
        return orderVo;
    }
}
